package app.menu;

import puri01.game.GameControlGroup;
import puri01.game.GamePlatformInfo;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.view.MotionEvent;
import app.game.common.Global;

public class SceneResult extends ProJect {

	public SceneResult(GameControlGroup gameControlGroup) {
		super(gameControlGroup);
		
		gameControlGroup.addControl(this);
	}

	private Canvas _Canvas = null;
	private Paint _Paint = null;

	@Override
	protected void onStart(GamePlatformInfo platformInfo) {
		_Canvas = platformInfo.getCanvas();
		_Paint = platformInfo.getPaint();
	}

	@Override
	protected void onDraw(GamePlatformInfo platformInfo) {
		_Paint.setARGB(255, 0, 0, 0);
		_Canvas.drawRect(0, 0, _Canvas.getWidth(), _Canvas.getHeight(), _Paint);
		
		int point = Global.gameInformation.getPoint();

		_Paint.setARGB(255, 255, 255, 255);
		_Canvas.drawText("Game Result...", 100, 100, _Paint);
		_Canvas.drawText("  * Point : " + Integer.toString(point) , 100, 120, _Paint);
		_Canvas.drawText("  Touch the screen to continue...", 100, 200, _Paint);
}
	
	@Override
    protected boolean onTouchEvent(GamePlatformInfo platformInfo, MotionEvent event) {
		if (event.getAction() == MotionEvent.ACTION_DOWN) {		
			PJManager.getInstance().main(null);
		}

		return true;
    }

}
